<?php
header('Access-Control-Allow-Origin: *');
// header("Access-Control-Allow-Credentials: true"); // 不能和上面的*同时设置
header("Access-Control-Allow-Methods: OPTIONS, GET, POST, PUT, DELETE");
// 允许前端在接口中传递的header字段
header("Access-Control-Allow-Headers: Content-Type, Cache-Control, Authorization, x-requested-with, X-Requested_With, Access-Token, token, authorization");
header("Access-Control-Expose-Headers: *");

use Illuminate\Support\Facades\Route;


//允许跨域
Route::group(['namespace' => 'WebApi'], function () {
    Route::post('goTest', 'TestController@goTest');//测试测试
    Route::post('auth/login', 'AuthController@login');//登录
    Route::get('login/captcha', 'CaptchaController@index');//验证码
});

//登录校验和允许跨域
Route::group(['namespace' => 'WebApi', 'middleware' => ['ApiAuth']], function () {
    Route::post('auth/groupAdd', 'AuthController@groupAdd');//添加权限组
    Route::get('auth/groupList', 'AuthController@groupList');//权限组列表
    Route::post('auth/groupEdit', 'AuthController@groupEdit');//编辑权限组
    Route::post('auth/groupDel', 'AuthController@groupDel');//删除权限组
    Route::post('auth/roleAdd', 'AuthController@roleAdd');//添加角色
    Route::get('auth/roleList', 'AuthController@roleList');//角色列表
    Route::post('auth/roleEdit', 'AuthController@roleEdit');//编辑角色
    Route::post('auth/roleDel', 'AuthController@roleDel');//删除角色
    Route::get('auth/adminList', 'AuthController@adminList');//管理员列表
    Route::post('auth/adminAdd', 'AuthController@adminAdd');//添加管理员
    Route::post('auth/adminDel', 'AuthController@adminDel');//删除管理员
    Route::post('auth/accountAdd', 'AuthController@accountAdd');//添加账号
    Route::get('auth/accountList', 'AuthController@accountList');//账号列表
    Route::post('auth/accountEdit', 'AuthController@accountEdit');//编辑账号
    Route::post('auth/accountDel', 'AuthController@accountDel');//删除账号
    Route::post('auth/menuAdd', 'AuthController@menuAdd');//添加菜单
    Route::post('auth/menuEdit', 'AuthController@menuEdit');//编辑菜单
    Route::post('auth/setRoleAuth', 'AuthController@setRoleAuth');//设置角色 菜单或操作权限
    Route::get('auth/menuList', 'AuthController@menuList');//菜单列表，当前角色所属菜单
    Route::get('auth/operationAuth', 'AuthController@operationAuth');//当前用户的菜单相关操作
    Route::post('auth/setOpAuth', 'AuthController@setOpAuth');//设置操作权限
    Route::post('auth/logout', 'AuthController@logout');//退出
    Route::get('auth/allRoles', 'AuthController@allRoles');//所有权限组与角色
    Route::post('config/setServer', 'ConfigController@setServer');//服务端配置
    Route::get('config/getServer', 'ConfigController@getServer');//获取服务端配置
    Route::post('config/setClient', 'ConfigController@setClient');//客户端配置
    Route::get('config/getClient', 'ConfigController@getClient');//获取客户端配置
    Route::post('config/setting', 'ConfigController@setting');//添加或编辑服务端(客户端)配置
    Route::post('config/addThirdParty', 'ConfigController@addThirdParty');//添加第三方配置
    Route::post('config/editThirdParty', 'ConfigController@editThirdParty');//编辑第三方配置
    Route::get('config/getThirdParty', 'ConfigController@getThirdParty');//获取第三方配置列表
    Route::get('config/thirdPartySwitchList', 'ConfigController@thirdPartySwitchList');//第三方开关列表
    Route::post('config/setThirdPartySwitch', 'ConfigController@setThirdPartySwitch');//第三方开关设置
    Route::get('user/perCerList', 'CertificationController@perCerList');//个人认证列表
    Route::post('user/perCerAudit', 'CertificationController@perCerAudit');//审核
    Route::post('user/perCerDel', 'CertificationController@perCerDel');//删除个人认证，批量删除个人认证
    Route::get('user/entCerList', 'CertificationController@entCerList');//企业认证列表
    Route::post('user/entCerAudit', 'CertificationController@entCerAudit');//企业认证审核
    Route::post('user/entCerDel', 'CertificationController@entCerDel');//删除企业认证,批量删除企业认证
    Route::post('user/userAdd', 'UserController@userAdd');//创建用户
    Route::post('user/robotAdd', 'UserController@robotAdd');//生成机器人
    Route::get('user/userList', 'UserController@userList');//用户列表
    Route::post('user/userEdit', 'UserController@userEdit');//编辑用户
    Route::post('user/resetPassword', 'UserController@resetPassword');//重置用户密码
    Route::post('user/userDel', 'UserController@userDel');//批量或单个删除用户
    Route::post('balance/recharge', 'BalanceController@recharge');//后台充值
    Route::post('balance/setStatus', 'BalanceController@setStatus');//后台锁定(冻结)用户余额
    Route::get('balance/payLogs', 'BalanceController@payLogs');//用户流水，后台充值，微信支付，支付宝支付等
    Route::get('user/myFriend', 'UserController@myFriend');//好友管理
    Route::get('user/addressBook', 'UserController@addressBook');//通讯录
    Route::post('user/inviteCodeAdd', 'UserController@inviteCodeAdd');//生成邀请码
    Route::post('user/inviteCodeDel', 'UserController@inviteCodeDel');//删除邀请码
    Route::get('user/inviteCodeList', 'UserController@inviteCodeList');//邀请码列表
    Route::post('user/banned', 'UserController@banned');//封禁用户
    Route::post('user/unBanned', 'UserController@unBanned');//解除封禁
    Route::post('user/sendWarning', 'UserController@sendWarning');//警告用户
    Route::get('group/groupList', 'GroupController@groupList');//群组列表
    Route::post('group/groupAdd', 'GroupController@groupAdd');//创建群组
    Route::post('group/addGroupUsers', 'GroupController@addGroupUsers');//添加群成员
    Route::get('group/getGroupUsers', 'GroupController@getGroupUsers');//获取群成员
    Route::post('group/delGroupUser', 'GroupController@delGroupUser');//移除群成员
    Route::post('group/delManyGroupUser', 'GroupController@delManyGroupUser');//批量移除群成员
    Route::post('group/sendText', 'GroupController@sendText');//发送群文本信息
    Route::post('group/setStatus', 'GroupController@setStatus');//锁定与解锁
    Route::post('group/delGroup', 'GroupController@delGroup');//解散群
    Route::get('group/getConfig', 'GroupController@getConfig');//获取群配置
    Route::post('group/saveConfig', 'GroupController@saveConfig');//保存群配置
    Route::post('group/addManyBanned', 'GroupController@addManyBanned');//批量禁言群成员
    Route::post('group/removeManyBanned', 'GroupController@removeManyBanned');//批量解除群成员禁言
    Route::get('opLogs/logList', 'OperationLogsController@LogList');//后台操作日志
    Route::get('fc/fcList', 'FriendsCircleController@fcList');//朋友圈信息列表
    Route::post('fc/praise', 'FriendsCircleController@praise');//朋友圈点赞
    Route::get('fc/praiseList', 'FriendsCircleController@praiseList');//朋友圈点赞列表
    Route::get('fc/commentList', 'FriendsCircleController@commentList');//朋友圈评论列表
    Route::post('fc/del', 'FriendsCircleController@del');//删除朋友圈
    Route::post('fc/shield', 'FriendsCircleController@shield');//单个或批量屏蔽朋友圈
    Route::post('fc/unshield', 'FriendsCircleController@unshield');//单个或批量解除屏蔽朋友圈
    Route::get('communication/audioList', 'CommunicationController@audioList');//音视频记录
    Route::get('files/fileList', 'FilesController@fileList');//上传文件列表
    Route::get('statistics', 'DashboardController@index');//首页面板数据汇总
    Route::get('feedback/list', 'FeedbackController@feedbackList');//意见反馈列表
    Route::get('feedback/details', 'FeedbackController@feedbackDetails');//意见反馈明细
    Route::post('feedback/process', 'FeedbackController@process');//意见反馈处理操作
    Route::get('feedback/reportList', 'FeedbackController@reportList');//投诉举报列表
    Route::post('feedback/reportProcess', 'FeedbackController@reportProcess');//投诉举报处理
    Route::get('feedback/reportDetails', 'FeedbackController@reportDetails');//投诉举报明细
    Route::get('feedback/reportCateList', 'FeedbackController@reportCateList');//举报原因列表
    Route::post('feedback/reportCateAdd', 'FeedbackController@reportCateAdd');//添加举报原因
    Route::post('feedback/reportCateEdit', 'FeedbackController@reportCateEdit');//编辑举报原因
    Route::post('feedback/reportCateDel', 'FeedbackController@reportCateDel');//删除举报原因
    Route::get('feedback/feedbackProcessDetails', 'FeedbackController@feedbackProcessDetails');//查看意见反馈处理进度
    Route::get('feedback/reportProcessDetails', 'FeedbackController@reportProcessDetails');//查看举报处理进度

    //直播
    Route::get('live/streamsOnlineList', 'LiveController@streamsOnlineList');//获取域名在线流列表
});
